package system.data;

/* @(#)system/base/C:\\Documents and Settings\\Administrator\\桌面\\APEP3\\JavaSourceOutput\ProductTypeBase.java    V1.0
 *
 * Project: APEP 
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *       {CREATE_TIME} First release
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2007 Auto-Parts E-Procurement Co., Ltd. 
 *        No.251-1 Wuning Road, Shanghai, 200063, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Auto-Parts E-Procurement Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with APEP.
 *
 * Warning:
 * =============================================================================
 *   
 * 
 */

import java.util.*;

import framework.core.*;
/*
	Author    :
	CreateTime:{CREATE_TIME}
*/
public class ProductTypeBase extends Table 
{
public static final String TABLE_NAME = "t_product_type";

private static final String BACKUP_TABLE_NAME = "t_product_type_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_PRODUCT_TYPE_BACKUP";


public static final String ID = "ID";

public static final String PRODUCT_ID = "PRODUCT_ID";

public static final String PRODUCT_CODE = "PRODUCT_CODE";

public static final String PRODUCT_TYPE = "PRODUCT_TYPE";

public static final String PROVIDER_CODE = "PROVIDER_CODE";

public static final String REMARK = "REMARK";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String LAST_UPDATE_TIME = "LAST_UPDATE_TIME";

public static final String LAST_UPDATE_USER = "LAST_UPDATE_USER";

public static final String LAST_UPDATE_USER_ID = "LAST_UPDATE_USER_ID";

public static final String IS_BID = "IS_BID";

public static final String IS_BALANCE = "IS_BALANCE";

public static final String STATUS = "STATUS";


public static Vector m_fields = null;


private String m_ID = ""; //ID

private String m_PRODUCT_ID = ""; //PRODUCT_ID

private String m_PRODUCT_CODE = ""; //PRODUCT_CODE

private int m_PRODUCT_TYPE = Value.NULL_INT;  //PRODUCT_TYPE

private String m_PROVIDER_CODE = ""; //PROVIDER_CODE

private String m_REMARK = ""; //REMARK

private String m_CREATE_TIME = ""; //CREATE_TIME

private String m_CREATE_USER = ""; //CREATE_USER

private String m_CREATE_USER_ID = ""; //CREATE_USER_ID

private String m_LAST_UPDATE_TIME = ""; //LAST_UPDATE_TIME

private String m_LAST_UPDATE_USER = ""; //LAST_UPDATE_USER

private String m_LAST_UPDATE_USER_ID = ""; //LAST_UPDATE_USER_ID

private int m_IS_BID = Value.NULL_INT;  //IS_BID

private int m_IS_BALANCE = Value.NULL_INT;  //IS_BALANCE



	public String getId()
	{
	    return m_ID;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_ID = v ;
		markDirty(ID);
	}

	public String getProductId()
	{
	    return m_PRODUCT_ID;
	}
	public void  setProductId(String v)
	{
		if(getProductId().equals(v)) return ;
		m_PRODUCT_ID = v ;
		markDirty(PRODUCT_ID);
	}

	public String getProductCode()
	{
	    return m_PRODUCT_CODE;
	}
	public void  setProductCode(String v)
	{
		if(getProductCode().equals(v)) return ;
		m_PRODUCT_CODE = v ;
		markDirty(PRODUCT_CODE);
	}

	public int getProductType()
	{
	    return m_PRODUCT_TYPE;
	}
	public void  setProductType(int v)
	{
		if(getProductType()==v) return ;
		m_PRODUCT_TYPE = v ;
		markDirty(PRODUCT_TYPE);
	}

	public String getProviderCode()
	{
	    return m_PROVIDER_CODE;
	}
	public void  setProviderCode(String v)
	{
		if(getProviderCode().equals(v)) return ;
		m_PROVIDER_CODE = v ;
		markDirty(PROVIDER_CODE);
	}

	public String getRemark()
	{
	    return m_REMARK;
	}
	public void  setRemark(String v)
	{
		if(getRemark().equals(v)) return ;
		m_REMARK = v ;
		markDirty(REMARK);
	}

	public String getCreateTime()
	{
	    return m_CREATE_TIME;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_CREATE_TIME = v ;
		markDirty(CREATE_TIME);
	}

	public String getCreateUser()
	{
	    return m_CREATE_USER;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_CREATE_USER = v ;
		markDirty(CREATE_USER);
	}

	public String getCreateUserId()
	{
	    return m_CREATE_USER_ID;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_CREATE_USER_ID = v ;
		markDirty(CREATE_USER_ID);
	}

	public String getLastUpdateTime()
	{
	    return m_LAST_UPDATE_TIME;
	}
	public void  setLastUpdateTime(String v)
	{
		if(getLastUpdateTime().equals(v)) return ;
		m_LAST_UPDATE_TIME = v ;
		markDirty(LAST_UPDATE_TIME);
	}

	public String getLastUpdateUser()
	{
	    return m_LAST_UPDATE_USER;
	}
	public void  setLastUpdateUser(String v)
	{
		if(getLastUpdateUser().equals(v)) return ;
		m_LAST_UPDATE_USER = v ;
		markDirty(LAST_UPDATE_USER);
	}

	public String getLastUpdateUserId()
	{
	    return m_LAST_UPDATE_USER_ID;
	}
	public void  setLastUpdateUserId(String v)
	{
		if(getLastUpdateUserId().equals(v)) return ;
		m_LAST_UPDATE_USER_ID = v ;
		markDirty(LAST_UPDATE_USER_ID);
	}

	public int getIsBid()
	{
	    return m_IS_BID;
	}
	public void  setIsBid(int v)
	{
		if(getIsBid()==v) return ;
		m_IS_BID = v ;
		markDirty(IS_BID);
	}

	public int getIsBalance()
	{
	    return m_IS_BALANCE;
	}
	public void  setIsBalance(int v)
	{
		if(getIsBalance()==v) return ;
		m_IS_BALANCE = v ;
		markDirty(IS_BALANCE);
	}



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewProductId(DBConnection con) throws Exception
	{
		return Value.view(getProductId());
	}

	public String viewProductCode(DBConnection con) throws Exception
	{
		return Value.view(getProductCode());
	}

	public String viewProductType(DBConnection con) throws Exception
	{
		return Value.view(getProductType());
	}

	public String viewProviderCode(DBConnection con) throws Exception
	{
		return Value.view(getProviderCode());
	}

	public String viewRemark(DBConnection con) throws Exception
	{
		return Value.view(getRemark());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewLastUpdateTime(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateTime());
	}

	public String viewLastUpdateUser(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateUserId(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewIsBid(DBConnection con) throws Exception
	{
		return Value.view(getIsBid());
	}

	public String viewIsBalance(DBConnection con) throws Exception
	{
		return Value.view(getIsBalance());
	}



public ProductTypeBase()
{
}

public void fill(ProductTypePageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getProductId()!=null)
	{	
		setProductId(pageData.getProductId());
	}

	if(pageData.getProductCode()!=null)
	{	
		setProductCode(pageData.getProductCode());
	}

	if( pageData.getProductType()!=null && 
	   !pageData.getProductType().equals(""))
	{	
		setProductType(Integer.parseInt(pageData.getProductType()));
	}

	if(pageData.getProviderCode()!=null)
	{	
		setProviderCode(pageData.getProviderCode());
	}

	if(pageData.getRemark()!=null)
	{	
		setRemark(pageData.getRemark());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getLastUpdateTime()!=null)
	{	
		setLastUpdateTime(pageData.getLastUpdateTime());
	}

	if(pageData.getLastUpdateUser()!=null)
	{	
		setLastUpdateUser(pageData.getLastUpdateUser());
	}

	if(pageData.getLastUpdateUserId()!=null)
	{	
		setLastUpdateUserId(pageData.getLastUpdateUserId());
	}

	if( pageData.getIsBid()!=null && 
	   !pageData.getIsBid().equals(""))
	{	
		setIsBid(Integer.parseInt(pageData.getIsBid()));
	}

	if( pageData.getIsBalance()!=null && 
	   !pageData.getIsBalance().equals(""))
	{	
		setIsBalance(Integer.parseInt(pageData.getIsBalance()));
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"ID"));

		m_fields.add(new Field(PRODUCT_ID,Value.TYPE_STRING,false,true,32,"PRODUCT_ID"));

		m_fields.add(new Field(PRODUCT_CODE,Value.TYPE_STRING,false,true,50,"PRODUCT_CODE"));

		m_fields.add(new Field(PRODUCT_TYPE,Value.TYPE_INT,false,true,0,"PRODUCT_TYPE"));

		m_fields.add(new Field(PROVIDER_CODE,Value.TYPE_STRING,false,true,32,"PROVIDER_CODE"));

		m_fields.add(new Field(REMARK,Value.TYPE_STRING,false,true,50,"REMARK"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,true,32,"CREATE_TIME"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,true,32,"CREATE_USER"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,true,32,"CREATE_USER_ID"));

		m_fields.add(new Field(LAST_UPDATE_TIME,Value.TYPE_STRING,false,true,32,"LAST_UPDATE_TIME"));

		m_fields.add(new Field(LAST_UPDATE_USER,Value.TYPE_STRING,false,true,32,"LAST_UPDATE_USER"));

		m_fields.add(new Field(LAST_UPDATE_USER_ID,Value.TYPE_STRING,false,true,32,"LAST_UPDATE_USER_ID"));

		m_fields.add(new Field(IS_BID,Value.TYPE_INT,false,true,0,"IS_BID"));

		m_fields.add(new Field(IS_BALANCE,Value.TYPE_INT,false,true,0,"IS_BALANCE"));
	

	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_ID = getString(rs,ID);

	m_PRODUCT_ID = getString(rs,PRODUCT_ID);

	m_PRODUCT_CODE = getString(rs,PRODUCT_CODE);

	m_PRODUCT_TYPE = getInt(rs,PRODUCT_TYPE);

	m_PROVIDER_CODE = getString(rs,PROVIDER_CODE);

	m_REMARK = getString(rs,REMARK);

	m_CREATE_TIME = getString(rs,CREATE_TIME);

	m_CREATE_USER = getString(rs,CREATE_USER);

	m_CREATE_USER_ID = getString(rs,CREATE_USER_ID);

	m_LAST_UPDATE_TIME = getString(rs,LAST_UPDATE_TIME);

	m_LAST_UPDATE_USER = getString(rs,LAST_UPDATE_USER);

	m_LAST_UPDATE_USER_ID = getString(rs,LAST_UPDATE_USER_ID);

	m_IS_BID = getInt(rs,IS_BID);

	m_IS_BALANCE = getInt(rs,IS_BALANCE);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(PRODUCT_ID))
	{
		return new Value(getProductId());
	}

	if(f.equalsIgnoreCase(PRODUCT_CODE))
	{
		return new Value(getProductCode());
	}

	if(f.equalsIgnoreCase(PRODUCT_TYPE))
	{
		return new Value(getProductType());
	}

	if(f.equalsIgnoreCase(PROVIDER_CODE))
	{
		return new Value(getProviderCode());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		return new Value(getRemark());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		return new Value(getLastUpdateTime());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		return new Value(getLastUpdateUser());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		return new Value(getLastUpdateUserId());
	}

	if(f.equalsIgnoreCase(IS_BID))
	{
		return new Value(getIsBid());
	}

	if(f.equalsIgnoreCase(IS_BALANCE))
	{
		return new Value(getIsBalance());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_ID))
	{
		setProductId(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_CODE))
	{
		setProductCode(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_TYPE))
	{
		setProductType(v.getInt());
	}

	if(f.equalsIgnoreCase(PROVIDER_CODE))
	{
		setProviderCode(v.getString());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		setRemark(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		setLastUpdateTime(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		setLastUpdateUser(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		setLastUpdateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(IS_BID))
	{
		setIsBid(v.getInt());
	}

	if(f.equalsIgnoreCase(IS_BALANCE))
	{
		setIsBalance(v.getInt());
	}
	
}
public String toString()
{
	String msg = "ProductType=\n";
	msg += "(\r\n";

	msg += "    ID(ID)="+get("ID")+"\r\n";

	msg += "    PRODUCT_ID(PRODUCT_ID)="+get("PRODUCT_ID")+"\r\n";

	msg += "    PRODUCT_CODE(PRODUCT_CODE)="+get("PRODUCT_CODE")+"\r\n";

	msg += "    PRODUCT_TYPE(PRODUCT_TYPE)="+get("PRODUCT_TYPE")+"\r\n";

	msg += "    PROVIDER_CODE(PROVIDER_CODE)="+get("PROVIDER_CODE")+"\r\n";

	msg += "    REMARK(REMARK)="+get("REMARK")+"\r\n";

	msg += "    CREATE_TIME(CREATE_TIME)="+get("CREATE_TIME")+"\r\n";

	msg += "    CREATE_USER(CREATE_USER)="+get("CREATE_USER")+"\r\n";

	msg += "    CREATE_USER_ID(CREATE_USER_ID)="+get("CREATE_USER_ID")+"\r\n";

	msg += "    LAST_UPDATE_TIME(LAST_UPDATE_TIME)="+get("LAST_UPDATE_TIME")+"\r\n";

	msg += "    LAST_UPDATE_USER(LAST_UPDATE_USER)="+get("LAST_UPDATE_USER")+"\r\n";

	msg += "    LAST_UPDATE_USER_ID(LAST_UPDATE_USER_ID)="+get("LAST_UPDATE_USER_ID")+"\r\n";

	msg += "    IS_BID(IS_BID)="+get("IS_BID")+"\r\n";

	msg += "    IS_BALANCE(IS_BALANCE)="+get("IS_BALANCE")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(ProductTypeBase srcObj)
{

	setProductId(srcObj.getProductId());

	setProductCode(srcObj.getProductCode());

	setProductType(srcObj.getProductType());

	setProviderCode(srcObj.getProviderCode());

	setRemark(srcObj.getRemark());

	setCreateTime(srcObj.getCreateTime());

	setCreateUser(srcObj.getCreateUser());

	setCreateUserId(srcObj.getCreateUserId());

	setLastUpdateTime(srcObj.getLastUpdateTime());

	setLastUpdateUser(srcObj.getLastUpdateUser());

	setLastUpdateUserId(srcObj.getLastUpdateUserId());

	setIsBid(srcObj.getIsBid());

	setIsBalance(srcObj.getIsBalance());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<ProductType>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<ProductId>"+Value.view(getProductId())+"</ProductId>";

	xml += "<ProductCode>"+Value.view(getProductCode())+"</ProductCode>";

	xml += "<ProductType>"+Value.view(getProductType())+"</ProductType>";

	xml += "<ProviderCode>"+Value.view(getProviderCode())+"</ProviderCode>";

	xml += "<Remark>"+Value.view(getRemark())+"</Remark>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<LastUpdateTime>"+Value.view(getLastUpdateTime())+"</LastUpdateTime>";

	xml += "<LastUpdateUser>"+Value.view(getLastUpdateUser())+"</LastUpdateUser>";

	xml += "<LastUpdateUserId>"+Value.view(getLastUpdateUserId())+"</LastUpdateUserId>";

	xml += "<IsBid>"+Value.view(getIsBid())+"</IsBid>";

	xml += "<IsBalance>"+Value.view(getIsBalance())+"</IsBalance>";
	
	xml += "</ProductType>";
	return xml;
}

}
